import 'dart:core';

import 'package:getx_learn/app/modules/weichat_post/entity/index.dart';
import 'package:getx_learn/app/modules/weichat_post/entity/timeline/comment.dart';
import 'package:getx_learn/app/modules/weichat_post/entity/timeline/like.dart';
import 'package:getx_learn/app/modules/weichat_post/entity/timeline/video.dart';
import 'package:json_annotation/json_annotation.dart';

part 'timeline.g.dart';

@JsonSerializable()
class TimelineModel {
  String? id;
  List<String>? images;
  VideoModel? video;
  String? content;
  @JsonKey(name: "post_type")
  String? postType;
  UserModel? user;
  String? publishDate;
  String? location;
  @JsonKey(name: "is_line")
  bool? isLike;

  List<LikeModel>? likes;

  List<CommentModel>? comments;

  TimelineModel(
      {this.id,
      this.images,
      this.video,
      this.content,
      this.postType,
      this.user,
      this.publishDate,
      this.location,
      this.isLike,
      this.likes,
      this.comments});

  factory TimelineModel.fromJson(Map<String, dynamic> json) =>
      _$TimelineModelFromJson(json);

  Map<String, dynamic> toJson() => _$TimelineModelToJson(this);
}
